//
//  NSString+Extension.h
//  MiGuPlay
//
//  Created by Migu on 16/9/8.
//  Copyright © 2016年 Migu. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString(Extension)

//! lowercase md5 string
- (NSString *)MD5LowercaseString;
//! uppercase md5 string
- (NSString *)MD5UppercaseString;

//! Base64 encode
- (NSString *)base64EncodeString;
//! Base64 decode
- (NSString *)base64DecodeString;

//! AES encrypt
- (NSString *)AESEncryptString;
- (NSString *)AESEncryptStringWithKey:(NSString *)key iv:(NSString *)iv;
//! AES decrypt
- (NSString *)AESDecryptString;
- (NSString *)AESDecryptStringWithKey:(NSString *)key iv:(NSString *)iv;

/// DSA signature(由于大网流量的密钥是JAVA生成的，OpenSSL无法使用，所以大网流量不要用这个签名方式)
- (NSString *)DASSignatureStringWithPublicKey:(NSString *)publicKey privateKey:(NSString *)privateKey;

/// URL encode，只用来处理中文问题
- (NSString *)URLEncodeString;

//URL encode，处理所以，包括？／等等
- (NSString *)URLEncodedStringAll;

//URL encode 所有
-(NSString *)URLDecodedStringAll;
/// 字符长度（英文1个字符；中文2个字符，Emoji3个字符）
- (NSUInteger)textLength;

///获取某两个字符之间数据 (可能字符中重复出现)
- (NSArray *)subStringFrom:(NSString *)startString to:(NSString *)endString;

-(NSString *)splitNameOrId;

- (NSArray *)splitDic;

@end
